<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>结算 - ShoppingEase</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#FF7D00',
                        success: '#00B42A',
                        warning: '#FF7D00',
                        danger: '#F53F3F',
                        dark: '#1D2129',
                        'dark-2': '#4E5969',
                        'light-1': '#F2F3F5',
                        'light-2': '#E5E6EB',
                        'light-3': '#C9CDD4'
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
</head>
<body class="font-inter bg-gray-50 text-dark">
    <!-- 顶部通知栏 -->
    <div class="bg-primary text-white text-center py-1 px-4 text-sm">
        <p>全场满199元免运费 | 新用户注册立减50元 <a href="register.html" class="underline font-medium">立即注册</a></p>
    </div>

    <!-- 导航栏 -->
    <header class="sticky top-0 z-50 bg-white shadow-sm">
        <div class="container mx-auto px-4">
            <div class="flex items-center justify-between h-16 md:h-20">
                <!-- Logo -->
                <a href="index.html" class="flex items-center space-x-2">
                    <i class="fa fa-shopping-bag text-primary text-2xl"></i>
                    <span class="text-xl font-bold text-primary">ShoppingEase</span>
                </a>

                <!-- 搜索栏 - 中等屏幕以上显示 -->
                <div class="hidden md:flex items-center flex-1 max-w-xl mx-8">
                    <div class="relative w-full">
                        <input type="text" placeholder="搜索商品、品牌或分类..." 
                            class="w-full py-2 pl-10 pr-4 rounded-full border border-light-2 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                        <button class="absolute left-3 top-1/2 transform -translate-y-1/2 text-light-3 hover:text-primary transition-colors">
                            <i class="fa fa-search"></i>
                        </button>
                        <button class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-primary text-white py-1 px-4 rounded-full hover:bg-primary/90 transition-colors">
                            搜索
                        </button>
                    </div>
                </div>

                <!-- 用户操作区 -->
                <div class="flex items-center space-x-4">
                    <!-- 搜索按钮 - 小屏幕显示 -->
                    <button class="md:hidden text-dark-2 hover:text-primary transition-colors">
                        <i class="fa fa-search text-xl"></i>
                    </button>
                    
                    <!-- 购物车 -->
                    <a href="cart.html" class="relative text-dark-2 hover:text-primary transition-colors">
                        <i class="fa fa-shopping-cart text-xl"></i>
                        <span id="cart-count" class="absolute -top-2 -right-2 bg-secondary text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">3</span>
                    </a>
                    
                    <!-- 用户菜单 -->
                    <div id="user-menu-container" class="relative">
                        <!-- 未登录状态 -->
                        <div id="guest-menu" class="flex items-center space-x-2">
                            <a href="login.html" class="text-dark-2 hover:text-primary transition-colors">
                                <i class="fa fa-user-circle-o text-xl"></i>
                            </a>
                            <div class="hidden md:block">
                                <a href="login.html" class="text-dark-2 hover:text-primary transition-colors">登录</a>
                                <span class="text-light-3 mx-1">/</span>
                                <a href="register.html" class="text-dark-2 hover:text-primary transition-colors">注册</a>
                            </div>
                        </div>
                        
                        <!-- 已登录状态 -->
                        <div id="user-menu" class="hidden">
                            <button id="profile-btn" class="flex items-center space-x-2 text-dark-2 hover:text-primary transition-colors">
                                <i class="fa fa-user-circle text-xl"></i>
                                <span id="username-display" class="hidden md:inline">用户名</span>
                                <i class="fa fa-angle-down text-xs"></i>
                            </button>
                            <div id="profile-dropdown" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg py-2 z-50">
                                <a href="profile.html" class="block px-4 py-2 text-sm text-dark-2 hover:bg-light-1 hover:text-primary transition-colors">
                                    <i class="fa fa-user-o mr-2"></i>个人中心
                                </a>
                                <a href="#" class="block px-4 py-2 text-sm text-dark-2 hover:bg-light-1 hover:text-primary transition-colors">
                                    <i class="fa fa-history mr-2"></i>我的订单
                                </a>
                                <a href="#" class="block px-4 py-2 text-sm text-dark-2 hover:bg-light-1 hover:text-primary transition-colors">
                                    <i class="fa fa-heart-o mr-2"></i>我的收藏
                                </a>
                                <div class="border-t border-light-2 my-1"></div>
                                <a href="#" id="logout-btn" class="block px-4 py-2 text-sm text-danger hover:bg-light-1 transition-colors">
                                    <i class="fa fa-sign-out mr-2"></i>退出登录
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 移动端搜索框 - 默认隐藏 -->
            <div class="py-3 hidden">
                <div class="relative w-full">
                    <input type="text" placeholder="搜索商品、品牌或分类..." 
                        class="w-full py-2 pl-10 pr-4 rounded-full border border-light-2 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                    <button class="absolute left-3 top-1/2 transform -translate-y-1/2 text-light-3 hover:text-primary transition-colors">
                        <i class="fa fa-search"></i>
                    </button>
                    <button class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-primary text-white py-1 px-4 rounded-full hover:bg-primary/90 transition-colors">
                        搜索
                    </button>
                </div>
            </div>
        </div>
    </header>

    <main class="py-8">
        <div class="container mx-auto px-4">
            <!-- 面包屑导航 -->
            <nav class="flex mb-4 text-sm">
                <a href="index.html" class="text-dark-2 hover:text-primary">首页</a>
                <span class="mx-2 text-light-3">/</span>
                <a href="cart.html" class="text-dark-2 hover:text-primary">购物车</a>
                <span class="mx-2 text-light-3">/</span>
                <span class="text-dark">结算</span>
            </nav>

            <h1 class="text-2xl font-bold mb-6">确认订单信息</h1>

            <!-- 进度步骤 -->
            <div class="mb-8">
                <div class="flex justify-between items-center max-w-3xl mx-auto">
                    <div class="flex flex-col items-center">
                        <div class="w-10 h-10 rounded-full bg-primary text-white flex items-center justify-center font-medium">1</div>
                        <p class="mt-2 text-sm font-medium text-primary">购物车</p>
                    </div>
                    <div class="flex-1 h-1 bg-primary mx-2"></div>
                    <div class="flex flex-col items-center">
                        <div class="w-10 h-10 rounded-full bg-primary text-white flex items-center justify-center font-medium">2</div>
                        <p class="mt-2 text-sm font-medium text-primary">确认订单</p>
                    </div>
                    <div class="flex-1 h-1 bg-light-2 mx-2"></div>
                    <div class="flex flex-col items-center">
                        <div class="w-10 h-10 rounded-full bg-light-2 text-dark-2 flex items-center justify-center font-medium">3</div>
                        <p class="mt-2 text-sm font-medium text-dark-2">支付订单</p>
                    </div>
                    <div class="flex-1 h-1 bg-light-2 mx-2"></div>
                    <div class="flex flex-col items-center">
                        <div class="w-10 h-10 rounded-full bg-light-2 text-dark-2 flex items-center justify-center font-medium">4</div>
                        <p class="mt-2 text-sm font-medium text-dark-2">完成</p>
                    </div>
                </div>
            </div>

            <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
                <!-- 订单信息 -->
                <div class="lg:col-span-2 space-y-6">
                    <!-- 收货地址 -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex items-center justify-between mb-4">
                            <h2 class="text-lg font-bold">收货地址</h2>
                            <button class="text-primary hover:underline">添加新地址</button>
                        </div>
                        
                        <div class="space-y-4">
                            <div class="border-2 border-primary rounded-lg p-4 relative">
                                <div class="absolute top-3 right-3 bg-primary text-white text-xs py-0.5 px-2 rounded">默认</div>
                                <div class="flex items-center">
                                    <div class="w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center text-primary mr-4">
                                        <i class="fa fa-map-marker"></i>
                                    </div>
                                    <div>
                                        <div class="flex items-center">
                                            <span class="font-medium mr-4">张三</span>
                                            <span>13800138000</span>
                                        </div>
                                        <p class="mt-1 text-dark-2">北京市朝阳区建国路88号现代城SOHO B座1501室</p>
                                    </div>
                                    <div class="ml-auto">
                                        <button class="text-dark-2 hover:text-primary transition-colors mr-3">编辑</button>
                                        <button class="text-dark-2 hover:text-primary transition-colors">设为默认</button>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="border border-light-2 rounded-lg p-4 hover:border-primary transition-colors cursor-pointer">
                                <div class="flex items-center">
                                    <div class="w-10 h-10 rounded-full bg-light-1 flex items-center justify-center text-dark-2 mr-4">
                                        <i class="fa fa-map-marker"></i>
                                    </div>
                                    <div>
                                        <div class="flex items-center">
                                            <span class="font-medium mr-4">李四</span>
                                            <span>13900139000</span>
                                        </div>
                                        <p class="mt-1 text-dark-2">上海市浦东新区张江高科技园区博云路2号浦软大厦1203室</p>
                                    </div>
                                    <div class="ml-auto">
                                        <button class="text-dark-2 hover:text-primary transition-colors mr-3">编辑</button>
                                        <button class="text-dark-2 hover:text-primary transition-colors">设为默认</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 支付方式 -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <h2 class="text-lg font-bold mb-4">支付方式</h2>
                        
                        <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                            <div class="border-2 border-primary rounded-lg p-4 text-center cursor-pointer">
                                <i class="fa fa-credit-card text-2xl text-primary mb-2"></i>
                                <p class="font-medium">在线支付</p>
                            </div>
                            
                            <div class="border border-light-2 rounded-lg p-4 text-center hover:border-primary transition-colors cursor-pointer">
                                <i class="fa fa-credit-card text-2xl text-dark-2 mb-2"></i>
                                <p class="text-dark-2">银行转账</p>
                            </div>
                            
                            <div class="border border-light-2 rounded-lg p-4 text-center hover:border-primary transition-colors cursor-pointer">
                                <i class="fa fa-money text-2xl text-dark-2 mb-2"></i>
                                <p class="text-dark-2">货到付款</p>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 配送方式 -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <h2 class="text-lg font-bold mb-4">配送方式</h2>
                        
                        <div class="space-y-3">
                            <div class="border border-light-2 rounded-lg p-4 hover:border-primary transition-colors cursor-pointer">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <input type="radio" name="delivery" id="delivery1" checked class="mr-3">
                                        <label for="delivery1">
                                            <div class="font-medium">顺丰速运</div>
                                            <div class="text-sm text-dark-2 mt-1">预计2-3天送达，工作日配送</div>
                                        </label>
                                    </div>
                                    <div class="font-medium">¥18</div>
                                </div>
                            </div>
                            
                            <div class="border border-light-2 rounded-lg p-4 hover:border-primary transition-colors cursor-pointer">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <input type="radio" name="delivery" id="delivery2" class="mr-3">
                                        <label for="delivery2">
                                            <div class="font-medium">京东物流</div>
                                            <div class="text-sm text-dark-2 mt-1">预计1-2天送达，支持货到付款</div>
                                        </label>
                                    </div>
                                    <div class="font-medium">¥15</div>
                                </div>
                            </div>
                            
                            <div class="border border-light-2 rounded-lg p-4 hover:border-primary transition-colors cursor-pointer">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <input type="radio" name="delivery" id="delivery3" class="mr-3">
                                        <label for="delivery3">
                                            <div class="font-medium">圆通速递</div>
                                            <div class="text-sm text-dark-2 mt-1">预计3-5天送达，全国大部分地区覆盖</div>
                                        </label>
                                    </div>
                                    <div class="font-medium">¥12</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 发票信息 -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <h2 class="text-lg font-bold mb-4">发票信息</h2>
                        
                        <div class="space-y-4">
                            <div class="flex items-center">
                                <input type="radio" name="invoice" id="no-invoice" checked class="mr-3">
                                <label for="no-invoice">
                                    <div class="font-medium">不开发票</div>
                                </label>
                            </div>
                            
                            <div class="flex items-center">
                                <input type="radio" name="invoice" id="personal-invoice" class="mr-3">
                                <label for="personal-invoice">
                                    <div class="font-medium">个人发票</div>
                                </label>
                            </div>
                            
                            <div class="flex items-center">
                                <input type="radio" name="invoice" id="company-invoice" class="mr-3">
                                <label for="company-invoice">
                                    <div class="font-medium">企业发票</div>
                                </label>
                            </div>
                            
                            <div id="company-invoice-details" class="hidden pl-7 space-y-3">
                                <div>
                                    <label for="company-name" class="block text-sm font-medium text-dark-2 mb-1">公司名称</label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 订单摘要 -->
                <div>
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <h2 class="text-lg font-bold mb-4">订单摘要</h2>
                        
                        <!-- 商品列表 -->
                        <div id="checkout-items" class="space-y-4">
                            <!-- 商品会通过JavaScript动态渲染 -->
                        </div>
                        
                        <!-- 小计 -->
                        <div class="flex justify-between border-t border-light-2 pt-4 mt-4">
                            <p class="text-dark-2">小计</p>
                            <p id="subtotal-amount" class="font-medium">¥3,600.00</p>
                        </div>
                        
                        <!-- 运费 -->
                        <div class="flex justify-between border-t border-light-2 pt-4">
                            <p class="text-dark-2">运费</p>
                            <p class="font-medium">¥18</p>
                        </div>
                        
                        <!-- 优惠 -->
                        <div class="flex justify-between border-t border-light-2 pt-4">
                            <p class="text-dark-2">优惠</p>
                            <p class="font-medium text-danger">-¥300</p>
                        </div>
                        
                        <!-- 实付款 -->
                        <div class="flex justify-between border-t border-light-2 pt-4">
                            <p class="text-dark-2">实付款</p>
                            <p class="text-danger text-xl font-bold">¥3,318.00</p>
                        </div>
                    </div>
                    
                    <!-- 优惠券 -->
                    <div class="mb-6">
                        <div class="flex items-center">
                            <input type="text" placeholder="输入优惠码" class="flex-1 py-2 px-3 border border-light-2 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary">
                            <button class="bg-primary text-white px-4 py-2 rounded-r-lg hover:bg-primary/90 transition-colors">
                                应用
                            </button>
                        </div>
                    </div>
                    
                    <!-- 提交按钮 -->
                    <button id="submit-order-btn" class="w-full bg-primary text-white py-3 px-6 rounded-lg font-medium hover:bg-primary/90 transition-colors mb-3">
                        提交订单
                    </button>
                    
                    <button class="w-full bg-white text-primary border border-primary py-3 px-6 rounded-lg font-medium hover:bg-primary/5 transition-colors">
                        返回购物车
                    </button>
                </div>
            </div>
        </div>
    </main>

    <script>
        // 获取提交订单按钮
        const submitOrderBtn = document.getElementById('submit-order-btn');

        // 为按钮添加点击事件监听器
        submitOrderBtn.addEventListener('click', () => {
            // 跳转到结算成功页面
            window.location.href = 'payment-success.html';
        });
    </script>
</body>
</html>